When using systemd, polkit doesn't set the error even when returning false in g_initable_init
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
https://bugzilla.gnome.org/show_bug.cgi?id=670319
&error);
if (subject == NULL)
{
- g_warning ("Error getting session for the process we are in: %s (%s %d)",
- error->message,
- g_quark_to_string (error->domain),
- error->code);
- g_error_free (error);
+ if (error) /* polkit version 104 and older don't properly set error on failure */
+ {
+ g_warning ("Error getting session for the process we are in: %s (%s %d)",
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
+ g_error_free (error);
+ }
+ else
+ {
+ g_warning ("Error getting session for the process we are in");
+ }
goto out;
}